package model

import (
	"context"
	"service/ctrl"
	"service/model/mod"

	gpb "gitee.com/cloudapex/protos/crm_message/pb"
	"google.golang.org/grpc"
)

var InnMsg innMsg

func init() {
	ctrl.GCon.RegistClienter(mod.GCONN_NOTIFY, func(c *grpc.ClientConn) {
		InnMsg.cli = gpb.NewInNoticeClient(c)
	})
}

type innMsg struct {
	cli gpb.InNoticeClient
}

func (this *innMsg) GetList(ctx context.Context, in *gpb.InNoticeListReq) (*gpb.InNoticeListRes, error) {
	return this.cli.InNoticeList(ctx, in)
}
func (this *innMsg) InCrmNoticeList(ctx context.Context, in *gpb.InNoticeListReq) (*gpb.InNoticeListRes, error) {
	return this.cli.InCrmNoticeList(ctx, in)
}

func (this *innMsg) Add(ctx context.Context, in *gpb.InNoticeCreateReq) (*gpb.InNoticeCreateRes, error) {
	return this.cli.InNoticeCreate(ctx, in)
}
func (this *innMsg) Info(ctx context.Context, in *gpb.InNoticeCreateReq) (*gpb.InNoticeCreateRes, error) {
	return this.cli.InNoticeSelect(ctx, in)
}

func (this *innMsg) UpdateStatus(ctx context.Context, in *gpb.InNoticeStatusReq) (*gpb.InNoticeCreateRes, error) {
	return this.cli.InNoticeUpdateStatus(ctx, in)
}

func (this *innMsg) Update(ctx context.Context, in *gpb.InNoticeCreateReq) (*gpb.InNoticeCreateRes, error) {
	return this.cli.InNoticeUpdate(ctx, in)
}
